"""
书籍阅读记录模型
"""

from app import db


class Read(db.Model):
    # 定义表名
    __tablename__ = 'read'
    # 定义字段
    id = db.Column(db.Integer, primary_key=True)

    # 书名id
    book_id = db.Column(db.Integer, db.ForeignKey('read.id'), comment='目标书籍id')
    # 阅读时长
    duration = db.Column(db.Integer, comment='阅读时长-分钟')
    # 提交时间
    submit_time = db.Column(db.DateTime, comment='提交时间')
    # 阅读进度
    progress = db.Column(db.Integer, comment='阅读进度-百分比')
